﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="KhuyenMai.aspx.cs" Inherits="WebBanThuoc.KhuyenMai" %>

<asp:Content ID="Content2" ContentPlaceHolderID="main" runat="server">
<div class="tran_nav">
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb" style="width:30px; display:inline;">
          <a href="TrangChu.aspx" itemprop="url" >
            <span itemprop="title">Trang chủ</span>
          </a>
        </div>   <font>&raquo;</font>
        <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb" style="width:30px;  display:inline;">
                     <span itemprop="title">Khuyến mãi</span>
        </div>
 </div>
   
<% System.Collections.Generic.List<WebBanThuoc.DTO.TinTuc> list_tinKM = Session["list_tinKM"]
                     as System.Collections.Generic.List<WebBanThuoc.DTO.TinTuc>;%>
<% if (list_tinKM.Count > 0)
   { %>
   <div id="tinkm">
    <span style="font-size:20px;color:#8DC50A;font-weight:bold; margin:5px;line-height:35px; ">Tin khuyến mãi</span>
   <% for (int i = 0; i < list_tinKM.Count; i++)
      {%>
        
        <% if (i > 0)
           {%>
           <div style="width:100%; border-bottom: 1px solid #D2D1D1; float:left ">
            &nbsp;
           </div>
        <%} %>
         <div class="rows">
             <span class="km_tieude"><%=list_tinKM[i].TenTinTuc%></span>
   	         <div class="brief_km"> <%=list_tinKM[i].NoiDungSoLuoc%>  </div>
        </div> <!-- rows -->
     <%} %>
       <!--bắt đầu trang -->
    <div class="paging">
     <%int tkm_tongSoTrang = Session["tkm_tongSoTrang"] != null ? Convert.ToInt32(Session["tkm_tongSoTrang"]) : 0;
       for (int i = 1; i <= tkm_tongSoTrang; i++)
          { %>
            <a href='KhuyenMai.aspx?trang_km=<%= Request.Params["trang_km"] != null ? Request.Params["trang_km"] : "1" %>&trang=<%= i %>'> <span class='page'><%= i %></span></a>
            <%}%>
    </div> 
        <!--kết thúc trang -->
<div style="clear:both"></div>
</div> <!-- tinkm -->
   <% } %>

 
  <div class="middle_title" align="left" style="padding-top:30px; padding-bottom:10px">
  	<h1 style="font-weight:bold; color:#3EADE1; font-size:15pt">Sản phẩm khuyến mãi/giảm giá</h1></div>
    <div class="middle_content" style="vertical-align:top;">

         <asp:DataList ID="dl_products_km" runat="server" RepeatDirection="Horizontal" 
              HorizontalAlign="Left" CellPadding="2" 
               CellSpacing="1" EditItemStyle-VerticalAlign="Top" 
            CaptionAlign="Left" RepeatLayout="Table" RepeatColumns="3"
               style="float:left; width:606px;margin-left:10px;">
        <ItemTemplate>
         <div class="border_newproduct">
           <div>
           <a href="CTSanPham.aspx?maSanPham=<%#Eval("MaSanPham")%>">
            <img src="<%#Eval("CachDung")%>" alt='' style='height:115px; max-width:140px;' />
           </a>
        </div>
       
         <label style="height:35px; line-height:18px">
            <a title="<%#Eval("TenSanPham")%>" href="CTSanPham.aspx?maSanPham=<%#Eval("MaSanPham")%>">
               <%#Eval("TenSanPham")%>
            </a>
        </label>
        <span>
            <div> <%#double.Parse(Eval("GiaDaGiam").ToString()) != double.Parse(Eval("GiaBan").ToString()) ? "<font>" + Eval("GiaBan", "{0:#,0.##}") + "&nbsp;VNĐ</font><br/>" : "<span>" + Eval("GiaBan", "{0:#,0.##}") + "&nbsp;VNĐ</span><br/>"%></div>
            <span> <%#double.Parse(Eval("GiaDaGiam").ToString()) == double.Parse(Eval("GiaBan").ToString()) ? "<font></font><br/>" : Eval("GiaDaGiam", "{0:#,0.##}") + "&nbsp;VNĐ"%></span>
         </span>
         <label style="height:35px; padding-bottom:3px; padding-top:3px; font-size:12px; line-height:13px; color:#55B7E6"><%#Eval("KhuyenMai")%></label>
         <div class="btn_product">
            <input type="hidden" id="maSP" name="product_id" value="<%#Eval("MaSanPham")%>"/> 
            <span  class="form_search_button" style="margin-left:25px" > 
                <a href="CTSanPham.aspx?maSanPham=<%#Eval("MaSanPham")%>"><%#Eval("CoHang").ToString() =="True" ? "Mua hàng" : "Đặt hàng"%></a>
             </span>
          </div>
    </div> <!--border_newproduct-->
  </ItemTemplate>
  </asp:DataList>
   <!--bắt đầu trang -->
    <div class="paging">
    
     <%int km_tongSoTrang = Session["km_tongSoTrang"] != null ? Convert.ToInt32(Session["km_tongSoTrang"]) : 0;//tongSoTrang có sản phẩm trả về
          for (int i = 1; i <= km_tongSoTrang; i++)
          { %>
            <a href='KhuyenMai.aspx?trang=<%= Request.Params["trang"] != null ? Request.Params["trang"] : "1" %>&trang_km=<%=i %>'> <span class='page'><%= i %></span></a>
          <%}%> 
    </div> 
        <!--kết thúc trang -->

 </div><!-- end of middle_contentmodule-->
 
   

<% Session.Remove("list_tinKM");%>
<% Session.Remove("tkm_tongSoTrang");%>
<% Session.Remove("km_tongSoTrang");%>

<style>
    #tinkm{ width:595px; background-color: #EAF794; margin-left:3px; background-color: White;
    float:left;  border: 1px solid #CCC; border-radius: 3px;-o-border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;}
   #tinkm .rows {float:left; width:590px;  margin-bottom:5px; margin-left:5px; margin-top:5px; background-color:#FFF; min-height:75px; overflow:hidden }
   .brief_km{ margin: 5px; padding:5px; font-size:14px;color: Black; line-height:25px;}
   .km_tieude {text-decoration:none; color:#8DC50A; font-size:16px; font-weight:bold; margin:5px;line-height:35px;} 
  
     
</style>
</asp:Content>
